home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CICA 1993 April
/
CICA MS Windows - April 1993.iso
/
unzipped
/
programr
/
vbasic
/
sndex
/
vbsndex.txt
< prev
Wrap
Text File
|
1991-10-15
|
2KB
|
34 lines
Greetings!
There have been a lot of people asking how to create string
functions for VB in Turbo Pascal for Windows. Well, the answer actually
lies in another DLL that I uploaded called VBPOINT.DLL (VBPTR.ZIP). This
DLL contains a function LP2STR which copies the contents of a normal C
type of string variable (LPSTR) into a VB string and returns it all as
a string function.
What is not entirely obvious is that LP2STR can be called from
C and Pascal as well. All you need is the correct syntax and you can
create string functions for VB, without the CDK.
VBSNDEX.DLL contains one exported function SOUNDEX which returns
the Soundex code string for the string that is passed to the function. This
has functionality itself and you can look at SOUNDEX.MAK for how to use the
DLL. I was trying to find something that would be useful but that would not
take me too long to write in TPW. I didn't want to obscure the point which
is to create string functions for VB.
LP2STR takes a PChar and an integer as parmeters. Therefore, your
DLL must make use of the STRINGS unit. LP2STR creates a VB string, copies
your PChar into it and returns the handle to the new VB string. This is
what you return as your function result. You are then free to destroy your
string (although it will go away when your VB app terminates). Hope this
is not too convoluted. Let me know if you have questions.
Jonathan Zuck
User Friendly, Inc.
You are hereby granted liscence to make use of and distribute VBSNDEX.DLL
without compensation to UFI. VBSNDEX.PAS must be distributed with this
entire ZIP file (VBSNDEX.TXT, VBSNDEX.DLL, VBSNDEX.PAS). These rights
apply to programming and distribution only, not publication of any of the
code or text contained here. Call us at (202) 387 - 1949 if you have
questions regarding this liscence.